package com.example.netchat;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class CreateRoomServlet extends BaseServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2369946491921606000L;

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		String roomName = req.getParameter("roomName");

		String roomId = Datastore.createRoom(roomName);

		resp.getWriter().print(roomId);
	}
}
